// =======================================================================================================================

if (typeof window.onerror !== "undefined")
    window.onerror = function (eventOrMessage: any, source: string, fileno: number): any {
        var msgElement = document.createElement("div");
        msgElement.innerHTML = "<button type='button' class='close' data-dismiss='alert'>&times;</button><strong>"
        + (<string>eventOrMessage).replace(/\r\n/g, "<br/>\r\n") + "<br/>\r\nError source: " + source + " on line " + fileno + "<br/>\r\n</strong>\r\n";
        msgElement.className = "alert alert-error";
        document.body.appendChild(msgElement);
    } // TODO: Perhaps put this in a special error handling file and place in the document header.

// =======================================================================================================================

if (host.isDebugMode()) debugger;

// =======================================================================================================================
